package com.crb.oauth2.api.wechat.cp.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Package: com.github.binarywang.demo.wx.cp.common
 * Description：
 * Author: huangjian
 * Date:  2020/8/21 11:17
 * Modified By:
 * @author huangjian
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RestfulResult {
    private Integer code;
    private String message;
    private Object data;
    public static RestfulResult success(Object data){
        return new RestfulResult(200,"响应成功",data);
    }

    public static  RestfulResult error(String message){
        return new RestfulResult(500,message,null);
    }

    public static  RestfulResult error(Integer code,String message){
        return new RestfulResult(code,message,null);
    }
}
